﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using NDatabase;
using NDatabase.Api;

namespace yt.DataModel
{
    public static class DataOp
    {
        public static string DBName="DB.db";

        public static IOdb Open()
        {
            return OdbFactory.Open(DBName);
        }


        public static void initUser()
        {
            
            List<Users> userses = new List<Users>();


            using (var db = Open())
            {
                //db.Delete<Users>();
                var query = db.QueryAndExecute<Users>().ToList();
                if (query.Count > 0)
                    foreach (var userse in query)
                    {
                        db.Delete(userse);
                    }
                db.Store(userses);
            }

        }


        public static void initData()
        {
            
            int iDataId = 1;
            int iTaskId = 1;
            Task DY = new Task()
            {
                Id = iTaskId,
                Description = "钓鱼",
                StartTime =
                    (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 13, 00, 10)),
                EndTime = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 00, 00)),
                //Started = false,

                //ScreenPoints = new List<ScreenPoint>
                //{
                //    new ScreenPoint(new Point(50, 300)),
                //    new ScreenPoint(new Point(745, 440)),
                //    new ScreenPoint(new Point(1408, 65)),
                //    new ScreenPoint(new Point(832, 320)),
                //    new ScreenPoint(new Point(745, 441), deloy),
                //    new ScreenPoint(new Point(670, 584))
                //},
                IsNeedLoop = true,
                LoopType = LoopType.VPotint,

                //LoopEvent = new List<ScreenPoint>
                //{
                //    new ScreenPoint(new Point(975, 540)),
                //    new ScreenPoint(new Point(800, 505)),
                //    new ScreenPoint(new Point(800, 505)),
                //    new ScreenPoint(new Point(800, 505)),
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //    //new ScreenPoint(new Point(970, 170))
                //},
                //RunStatus = RunStatus.VReady,
                MinX = 0,
                MaxX = 0,
                MinY = 0,
                MaxY = 0,
                LoopDeloy = 181,
                IsResetScreen = true,
                ResetDeloy = 110,
                //IsReseted = false,
                WeekDay = "0,1,2,3,4,5,6"
            };
            List<OpData> dyDatas = new List<OpData>();
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 50, Y = 300, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 745, Y = 440, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 1408, Y = 65, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 832, Y = 320, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 745, Y = 441, OpType = 0, DeloyTime = 3000 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 670, Y = 584, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 975, Y = 540, OpType = 1 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 800, Y = 505, OpType = 1 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 800, Y = 505, OpType = 1 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 800, Y = 505, OpType = 1 });
            dyDatas.Add(new OpData
            {
                Id = iDataId++,
                TaskId = iTaskId,
                KeyType = KeyType.V_KEY,
                keyInput = WinAPI.VK_ESCAPE,
                X = 0,
                Y = 0,
                OpType = 1
            });
            Task BS = new Task()
            {
                Id = ++iTaskId,
                Description = "Boss",
                StartTime =
                    (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 26, 30)),
                EndTime = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 59, 00)),
                //Started = false,

                //ScreenPoints = new List<ScreenPoint>
                //{
                //    new ScreenPoint(new Point(1408, 65)),
                //    new ScreenPoint(new Point(834, 544), deloy),
                //    new ScreenPoint(new Point(1440, 160)),
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //},
                IsNeedLoop = false,
                LoopType = LoopType.VPotint,
                //LoopEvent = new List<ScreenPoint>
                //{
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //    //new ScreenPoint(new Point(970, 170))
                //},
                //RunStatus = RunStatus.VReady,
                MinX = 0,
                MaxX = 0,
                MinY = 0,
                MaxY = 0,
                LoopDeloy = 181,
                IsResetScreen = false,
                ResetDeloy = 110,
                //IsReseted = false,
                WeekDay = "0,1,2,3,4,5,6"
            };
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 1408, Y = 65, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 830, Y = 540, OpType = 0, DeloyTime = 3000 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 1450, Y = 150, OpType = 0 });
            dyDatas.Add(new OpData
            {
                Id = iDataId++,
                TaskId = iTaskId,
                KeyType = KeyType.V_KEY,
                keyInput = WinAPI.VK_ESCAPE,
                X = 0,
                Y = 0,
                OpType = 0
            });

            Task KL = new Task()
            {
                Id = ++iTaskId,
                Description = "昆仑",
                StartTime =
                    (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 19, 10, 30)),
                EndTime = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 19, 40, 00)),
                //Started = false,

                //ScreenPoints = new List<ScreenPoint>
                //{
                //    new ScreenPoint(new Point(1408, 65)),
                //    new ScreenPoint(new Point(834, 544), deloy),
                //    new ScreenPoint(new Point(1440, 160)),
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //},
                IsNeedLoop = true,
                LoopType = LoopType.VRamdom,
                //LoopEvent = new List<ScreenPoint>
                //{
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //    //new ScreenPoint(new Point(970, 170))
                //},
                //RunStatus = RunStatus.VReady,
                MinX = 280,
                MaxX = 1310,
                MinY = 230,
                MaxY = 660,
                LoopDeloy = 10,
                IsResetScreen = false,
                ResetDeloy = 110,
                //IsReseted = false,
                WeekDay = "0,1,2,3,4,5,6"
            };
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 745, Y = 280, OpType = 0, DeloyTime = 3000 });
            dyDatas.Add(new OpData
            {
                Id = iDataId++,
                TaskId = iTaskId,
                KeyType = KeyType.V_KEY,
                keyInput = WinAPI.VK_ESCAPE,
                X = 0,
                Y = 0,
                OpType = 0
            });
            //帮会战
            Task BH = new Task()
            {
                Id = ++iTaskId,
                Description = "帮会战",
                StartTime =
                    (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 20, 10)),
                EndTime = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 40, 00)),
                //Started = false,

                //ScreenPoints = new List<ScreenPoint>
                //{
                //    new ScreenPoint(new Point(1408, 65)),
                //    new ScreenPoint(new Point(834, 544), deloy),
                //    new ScreenPoint(new Point(1440, 160)),
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //},
                IsNeedLoop = false,
                LoopType = LoopType.VRamdom,
                //LoopEvent = new List<ScreenPoint>
                //{
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //    //new ScreenPoint(new Point(970, 170))
                //},
                //RunStatus = RunStatus.VReady,
                MinX = 280,
                MaxX = 1310,
                MinY = 230,
                MaxY = 660,
                LoopDeloy = 10,
                IsResetScreen = false,
                ResetDeloy = 110,
                //IsReseted = false,
                WeekDay = "1,3,5"
            };
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 1408, Y = 65, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 830, Y = 385, OpType = 0 });
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 745, Y = 440, OpType = 0, DeloyTime = 3000 });
            dyDatas.Add(new OpData
            {
                Id = iDataId++,
                TaskId = iTaskId,
                KeyType = KeyType.V_KEY,
                keyInput = WinAPI.VK_ESCAPE,
                X = 0,
                Y = 0,
                OpType = 0
            });

            //武林大会
            Task WL = new Task()
            {
                Id = ++iTaskId,
                Description = "武林大会",
                StartTime =
                    (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 11, 10)),
                EndTime = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 35, 00)),
                //Started = false,

                //ScreenPoints = new List<ScreenPoint>
                //{
                //    new ScreenPoint(new Point(1408, 65)),
                //    new ScreenPoint(new Point(834, 544), deloy),
                //    new ScreenPoint(new Point(1440, 160)),
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //},
                IsNeedLoop = true,
                LoopType = LoopType.VRamdom,
                //LoopEvent = new List<ScreenPoint>
                //{
                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                //    //new ScreenPoint(new Point(970, 170))
                //},
                //RunStatus = RunStatus.VReady,
                MinX = 280,
                MaxX = 1310,
                MinY = 230,
                MaxY = 660,
                LoopDeloy = 10,
                IsResetScreen = false,
                ResetDeloy = 110,
                //IsReseted = false,
                WeekDay = "2,4,6"
            };
            dyDatas.Add(new OpData { Id = iDataId++, TaskId = iTaskId, KeyType = KeyType.V_MOUSE, X = 745, Y = 435, OpType = 0, DeloyTime = 3000 });
            dyDatas.Add(new OpData
            {
                Id = iDataId++,
                TaskId = iTaskId,
                KeyType = KeyType.V_KEY,
                keyInput = WinAPI.VK_ESCAPE,
                X = 0,
                Y = 0,
                OpType = 0
            });
            using (var db = Open())
            {
                var query = db.QueryAndExecute<Task>();
                if (query.Count > 0)
                    foreach (var task in query)
                    {
                        db.Delete(task);
                    }
                    
                var query1 = db.QueryAndExecute<OpData>();
                if (query1.Count > 0)
                    foreach (var opData in query1)
                    {
                        db.Delete(opData);
                    }
                    
                db.Store(DY);//钓鱼
                db.Store(BS);//BOSS
                db.Store(KL);//昆仑
                db.Store(BH);//帮会战
                db.Store(WL);//帮会战


                db.Store(dyDatas);
            }
            
            int quizid = 1;
            var quizs = new List<Quizbase>();
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"NPC杨宇天请问在游戏中那个场景地图？", Result = @"琴港" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"帮会商店多少贡献可以兑换到英雄令(蓝）?", Result = @"1600" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"帮会种植在每天几点成熟？", Result = @"21:10" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"帮派战请问是在每周的星期几举行的，几点正式开始帮战？", Result = @"每周一、三、五20:20" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"宠物变身卡怎么获得？", Result = @"宠物界面变身入口购买" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"宠物成长请问需要达到多少级才可以开启最后一格技能槽？", Result = @"20级" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"宠物技能高级强身。请问增加多少百分比宠物的基础气血？", Result = @"60%" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"宠物系统请问每天可免费洗炼几次技能？", Result = @"1次" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"刺客盟的神功技能名称叫做什么？", Result = @"青龙吐息" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"打开技能面板快捷键是哪个键？", Result = @"V" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"打开角色面板快捷键是哪个键？", Result = @"C" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"地图中请问总共有多少张场景地图？", Result = @"10张" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"锻造装备强化幸运值请问有什么作用？", Result = @"增加成功率" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"队伍阵法请问以下哪种阵型能够提升队伍成员的暴击？", Result = @"八卦阵" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"高级幸运符。请问能提高多少百分比的强化成功率？", Result = @"15%" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"好友祝福赠送礼包。请问赠送高级礼包给对方能获得什么道具？", Result = @"中级洗炼石" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"合成特殊坐骑需要几个坐骑碎片？", Result = @"10个" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"欢乐挂机活动在每日的几时开始？", Result = @"12:10" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"黄金武魂每天能免费领取多少体力值？", Result = @"250" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"黄金武魂在竞技场每天可额外获得几次挑战次数？", Result = @"5" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"结婚需要双方亲密值多少才可以结婚？", Result = @"1500" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"昆仑山的活动在每日的几时开始？", Result = @"19:10" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"美味佳肴请问是在每日的几点和几点赠送？", Result = @"12:00/18:00" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"魅力排行第一名的称谓叫做什么？", Result = @"倾国倾城" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"秘境系统请问每天能免费刷新几次？", Result = @"1次" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"内功九阳神功是增加哪方面的属性？", Result = @"气血" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"内功九阴真经是增加哪方面的属性？", Result = @"内力" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"内功鹰爪功是增加哪方面的属性？", Result = @"攻击" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"强化套装效果请问以下那件部件是不属于套装范畴内？", Result = @"时装" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"请问倚天中哪个NPC会使用主角的神功技能？", Result = @"船家" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"什么品质的装备能够洗炼出增加技能等级的功效？", Result = @"橙色" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"提升宠物成长影响宠物哪方面的能力？", Result = @"开启技能槽" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"天刀门的神功技能名称叫做什么？", Result = @"玄武附身" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"通天峰第一个通关60层的队伍或个人奖励什么道具？", Result = @"20块英雄令" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"通天峰请问每天最多能够进入多少次？", Result = @"2次" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"通天峰请问总共有多少楼层霸主？", Result = @"5" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"逍遥剑派的神功技能名称叫做什么？", Result = @"朱雀剑雨" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"医仙谷的神功技能名称叫做什么？", Result = @"白虎神光" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"应天府有三个欢乐宝箱。请问初级欢乐宝箱抢夺是几级与几级的争夺？", Result = @"30-44" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"运镖活动请问是在每日的几点开始至几点结束？", Result = @"15:00-16:00" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"运镖活动中请问每人在一天中最多能够劫多少次镖？", Result = @"2次" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"在竞技场排名第一请问每日赠送的固定奖励是？", Result = @"500声望" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"中请问如何快速获得心法提升内功等级？", Result = @"挑战掌门人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"中请问倚天武器是通过以下哪种方法获得？", Result = @"碎片合成" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"中请问坐骑最高能强化到多少级？", Result = @"10级" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 1, Quiz = @"坐骑进阶成瑞兽麒麟，请问需要以下哪种道具材料才可完成进阶？", Result = @"麒麟进阶丹" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“白云深处有人家”的上一句是什么？", Result = @"远上寒山石径斜" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“爆竹声中一岁除”的下一句是什么？", Result = @"春风送暖入屠苏" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“碧玉妆成一树高”的下一句是什么？", Result = @"万条垂下绿丝绦" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“沧海月明珠有泪”的下一句是什么？", Result = @"蓝田日暖玉生烟" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“朝辞白帝彩云间”的下一句是什么？", Result = @"千里江陵一日还" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“抽刀断水水更流”的下一句是什么？", Result = @"举杯消愁愁更愁" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“出师未捷身先死”的下一句是什么？", Result = @"长使英雄泪满襟" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“春风又绿江南岸”的下一句是什么？", Result = @"明月何时照我还" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“此情可待成追忆”的下一句是什么？", Result = @"只是当时已惘然" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“大弦嘈嘈如急雨”的下一句是什么？", Result = @"小弦切切如私语" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“东风无力百花残”的上一句是什么？", Result = @"相见时难别亦难" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“功盖三分国”的下一句是什么？", Result = @"名成八阵图" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“孤帆远影碧空尽”的下一句是什么？", Result = @"惟见长江天际流" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“姑苏城外寒山寺”的下一句是什么？", Result = @"夜半钟声到客船" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“黄鹤一去不复返”的下一句是什么？", Result = @"白云千载空悠悠" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“几处早莺争暖树”的下一句是什么？", Result = @"谁家新燕啄春泥" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“剑外忽传收蓟北”的下一句是什么？", Result = @"初闻涕泪满衣裳" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“今人不见古时月”的下一句是什么？", Result = @"今月曾经照古人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“九曲黄河万里沙”的下一句是什么？", Result = @"浪淘风簸自天涯" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“客舍青青柳色新”的上一句是什么？", Result = @"渭城朝雨邑轻尘" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“莫愁前路无知己”的下一句是什么？", Result = @"天下谁人不识君" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“人生代代无穷已”的下一句是什么？", Result = @"江月年年只相似" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“人世几回伤往事”的下一句是什么？", Result = @"山形依旧枕寒流" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“日照香炉生紫烟”的下一句是什么？", Result = @"遥看瀑布挂前川" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“山外青山楼外楼”的下一句是什么？", Result = @"西湖歌舞几时休" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“舍南舍北皆春水”的下一句是什么？", Result = @"但见群鸥日日来" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“天生我材必有用”的下一句是什么？", Result = @"千金散尽还复来" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“我寄愁心与明月”的下一句是什么？", Result = @"随君直到夜郎西" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“我寄愁心与明月”的下一句是什么？", Result = @"随君直到夜郎西" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“昔人已乘黄鹤去”的下一句是什么？", Result = @"此地空余黄鹤楼" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“仰天大笑出门去”的下一句是什么？", Result = @"我辈岂是蓬蒿人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"“长风破浪会有时”的下一句是什么？", Result = @"直挂云帆济沧海" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"打起黄莺儿，莫教枝上啼。啼时惊妾梦，不得到辽西。请问这首诗的诗名叫做什么？", Result = @"春怨" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"独坐幽篁里，弹琴复长啸。深林人不知，明月来相照。请问这首诗的作者是谁？", Result = @"唐朝王维" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"孤云将野鹤，岂向人间住。莫买沃洲山，时人已知处。请问这首诗的诗名叫做什么？", Result = @"送上人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"故国三千里，深宫二十年。一声何满子，双泪落君前。请问这首诗的作者是谁？", Result = @"唐朝张祜" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"归山深浅去，须尽丘壑美。莫学武陵人，暂游桃源里。请问这首诗的作者是谁？", Result = @"唐朝裴迪" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"空山不见人，但闻人语响。返影入深林，复照青苔上。请问这首诗的作者是谁？", Result = @"唐朝王维" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"岭外音书绝，经冬复立春。近乡情更怯，不敢问来人。请问这首诗的诗名叫做什么？", Result = @"渡汉江" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"绿蚁新醅酒，红泥小火炉。晚来天欲雪，能饮一杯无。请问这首诗的诗名叫做什么？", Result = @"问刘十九" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"美人卷珠帘，深坐蹙蛾眉。但见泪痕湿，不知心恨谁。请问这首诗的诗名叫做什么？", Result = @"怨情" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"千山鸟飞绝，万径人踪灭。孤舟蓑笠翁，独钓寒江雪。请问这首诗的作者是谁？", Result = @"唐朝柳宗元" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"松下问童子，言师采药去。只在此山中，云深不知处。请问这首诗的诗名叫做什么？", Result = @"寻隐者不遇" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"向晚意不适，驱车登古原。夕阳无限好，只是近黄昏。请问这首诗的诗名叫做什么？", Result = @"登乐游原" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"移舟泊烟渚，日暮客愁新。野旷天低树，江清月近人。请问这首诗的诗名叫做什么？", Result = @"宿建德江" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 2, Quiz = @"终南阴岭秀，积雪浮云端。林表明霁色，城中增暮寒。请问这首诗的作者是谁？", Result = @"唐朝祖咏" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"“白雪公主”这个形象最早来自于？", Result = @"格林童话" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"“不惑之年”是指多少岁？", Result = @"40" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"“成也萧何，败也萧何”说的是谁的经历？", Result = @"韩信" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"“厄尔尼诺”现象是指一股很强的暖洋流，它会导致全球整体气温？", Result = @"升高" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"《悲惨世界》的主人公冉阿让因为偷了什么东西而服了19年的苦役?", Result = @"一片面包" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"《权利法案》标志着英国什么革命的胜利？", Result = @"资产阶级革命" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"《堂吉诃德》的作者塞万提斯是哪国人？", Result = @"西班牙" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"《西游记》中的火焰山位于？", Result = @"新疆" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"15～18世纪是欧美主要国家出现社会巨变的时代。社会巨变是指？", Result = @"资本主义取代封建主义" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"2002世界杯足球赛巴西、土耳其、德国与塞内加尔等中人口最多的是？", Result = @"巴西" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"2004年奥运会网球比赛中，获得女子双打冠军的选手是?", Result = @"孙甜甜李婷" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"2008年奥运会在哪个城市举行？", Result = @"北京" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"NBA联盟成立于哪一年？", Result = @"1896" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"NBA联赛中迈克尔乔丹曾经获得过几次总冠军?", Result = @"6次" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"巴西人最喜爱的一种舞蹈是？", Result = @"桑巴" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"北美人民反对英国殖民统治，争取民族独立的正义战争称为什么？", Result = @"独立战争" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"被称为“世界油王”的树是?", Result = @"油棕" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"达芬奇是哪国人？", Result = @"意大利" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"到今朝为止，世界博览会共举办了几届？", Result = @"41" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"第二次世界大战发生于哪一年？", Result = @"1939" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"第一届奥运会是哪一年举行的？", Result = @"1896" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"法国最著名的、是世界上最古老、最大、最著名的博物馆叫什么？", Result = @"卢浮宫" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"近代西洋歌剧产生于十六世纪末的哪个国家？", Result = @"意大利" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"口技专家是对哪个动物的美称？", Result = @"八哥" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"乐器“二胡”来源于？", Result = @"胡人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"历史上的“百日维新”实际持续的天数是多少天？", Result = @"103" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"麻将原是皇家王公贵族的游戏，起源于哪个国家?", Result = @"中国" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"马克思主义主要包括马克思主义哲学、马克思主义政治经济学和什么?", Result = @"科学社会主义" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"儒学的开创人是谁?", Result = @"孔子" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"三交贸易中，奴隶贩子的贸易路线是?", Result = @"欧洲→非洲→美洲→欧洲" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"英国资产阶级革命、美国独立战争、法国大革命的共同点是?", Result = @"促进了资本主义的发展" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"神话《白蛇传》中“白娘娘盗仙草”中的仙草指的是?", Result = @"灵芝" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"世界地球日的日期是？", Result = @"41386" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"世界上已知最毒的动物是?", Result = @"澳洲箱水母" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"世界上最早的宗教是?", Result = @"佛教" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"世上最大的地区范围性商业集团是？", Result = @"欧洲联盟" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"维纳斯是希腊神话中的？", Result = @"爱神和美神" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"文艺复兴时期伟大的天文学家哥白尼是哪国人?", Result = @"波兰" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"下面哪个地方最适合椰子生长？", Result = @"海南" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"以下产品中哪个是爱迪生的发明？", Result = @"电灯泡" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"以下什么东西是应用磁场的原理制作的?", Result = @"指南针" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"宇航员在宇宙空间看到的地球主要是什么颜色？", Result = @"蓝" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"圆明园是被什么联军焚毁的?", Result = @"英法" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"詹姆斯·瓦特是哪个国家著名的发明家？", Result = @"英国" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"著名的文艺复兴三杰全部诞生在哪个国家？", Result = @"意大利" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"资本家生产的目的是攫取工人创造的什么价值?", Result = @"剩余价值" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 3, Quiz = @"资本主义的发展经历两大阶段分别是自由竞争的资本主义和什么资本主义？", Result = @"垄断" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"独留花下人，有情却无心，猜一字？", Result = @"倩" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"枫树无风，旁边有位老公，猜一字？", Result = @"松" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"叫猫不抓鼠，像熊爱吃竹。摇摆惹人爱，是猫还是熊？(打一动物名）", Result = @"熊猫" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"孔子是我国最伟大的什么家?", Result = @"老人家" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"门里阳光照，门外雨飘飘，猜一个字？", Result = @"涧" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"哪一颗牙最后长出来？", Result = @"假牙" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"哪种竹子不长在土里？", Result = @"爆竹" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"你能做，我能做，大家都做；一个人能做，两个人不能一起做。这是做什么？", Result = @"做梦" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"逆水划船(打一成语）？", Result = @"力争上游" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"娘子娘子，身似盒子。麒麟剪刀，八个钗子。(打一动物名）", Result = @"蟹" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"枪弹上膛(打一成语）？", Result = @"一触即发" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"全面开荒(打一成语）？", Result = @"不留余地" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"鹊巢鸦占(打一成语）？", Result = @"化为乌有" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"日落相残洗却凡心一点,猜一个字？", Result = @"秃" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"上头去下头，下头去上头，两头去中间，中间去两头。谜底是？", Result = @"至" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"身小力不小，团结又勤劳。有时搬粮食，有时挖地道。(打一动物名）", Result = @"蚂蚁" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"身长约一丈，鼻生头顶上。背黑肚皮白，安家在海洋。(打一动物名）", Result = @"海豚" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么东西掉进水里不会湿？", Result = @"影子" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么东西天气越热，它爬的越高？", Result = @"温度计" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么东西愈生气，它便愈大?", Result = @"脾气" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么贵重的东西最容易不翼而飞?", Result = @"人造卫星" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么酒不能喝？", Result = @"碘酒" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么卡通人物最黑暗？", Result = @"哆啦A梦" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么门永远关不上?", Result = @"足球门" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么书谁也没见过?", Result = @"天书" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么样的官不能发号施令，还得老向别人陪笑？", Result = @"新郎官" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"什么最会弄虚作假?", Result = @"魔术师" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"四通八达(打一成语）？", Result = @"头头是道" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"为了怕身材走样，结婚后不生孩子的美女怎么称呼？", Result = @"绝代佳人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"小白+小白=？", Result = @"小白兔" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"用什么来判断鸡的年龄？", Result = @"用牙齿" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"制造日期与有效日期是同一天的产品是什么？", Result = @"报纸" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 4, Quiz = @"纵观历史上哪个人跑的最快?", Result = @"曹操" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"(程咬金）的斧头——就这三下子", Result = @"程咬金" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"(狗掀门帘)——全凭一张嘴", Result = @"狗掀门帘" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"(姜太公）钓鱼——愿者上钩", Result = @"姜太公" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"(秀才）遇着兵——有理说不清", Result = @"秀才" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"(哑巴)吃黄连——有苦说不出", Result = @"哑巴" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"(周瑜）打黄盖——一个愿打一个愿挨", Result = @"周瑜" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"5蝙蝠身上插鸡毛——(你算什么鸟）", Result = @"你算什么鸟" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"霸王敬酒——(不干也得干）", Result = @"不干也得干" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"仇人相见——(分外眼红）", Result = @"分外眼红" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"此地无银三百两——(不打自招）", Result = @"不打自招" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"从河南到湖南——(难上加难）", Result = @"难上加难" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"大姑娘坐轿——(头一回）", Result = @"头一回" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"关上门做皇帝——(自尊自大）", Result = @"自尊自大" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"猴子捞月亮——(空忙一场）", Result = @"空忙一场" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"虎落平阳——(被犬欺）", Result = @"被犬欺" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"荆轲刺秦王——(图穷匕现）", Result = @"图穷匕现" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"看衣服行事——(狗眼看人）", Result = @"狗眼看人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"孔夫子搬家——(尽是书）", Result = @"尽是书" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"鲁智深出家——(一无牵挂）", Result = @"一无牵挂" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"卖布不带尺——(存心不量）", Result = @"存心不量" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"骑驴看唱本——(走着瞧）", Result = @"走着瞧" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"山中无老虎——(猴子称霸王）", Result = @"猴子称霸王" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"水边放岩炮——(无处藏身）", Result = @"无处藏身" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"孙大圣听了紧箍咒——(头疼）", Result = @"头疼" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"孙悟空当齐天大圣——(自封为王）", Result = @"自封为王" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"脱裤子放屁——(多此一举）", Result = @"多此一举" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"脱了旧鞋换新鞋——(改鞋归正）", Result = @"改鞋归正" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"戏台上喝彩——(自吹自擂）", Result = @"自吹自擂" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"瞎子拉琴——(瞎扯）", Result = @"瞎扯" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"瞎子坐上席——(目中无人）", Result = @"目中无人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"小葱拌豆腐——(一清二白）", Result = @"一清二白" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"医生卖棺材——(死活都要钱）", Result = @"死活都要钱" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"针尖对麦芒——(尖对尖）", Result = @"尖对尖" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"纸里裹火——(藏不住）", Result = @"藏不住" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 5, Quiz = @"猪八戒照镜——(里外不是人）", Result = @"里外不是人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》成昆因为发生什么事情而导致变成无恶不作的坏人?", Result = @"心胸狭窄" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》蝶谷医仙胡青牛的妹妹叫?", Result = @"胡青羊" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》断骨可以使用什么药接回？", Result = @"黑玉断续膏" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》峨眉派是由谁建立而成？", Result = @"郭襄" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》峨嵋派丁敏君的绰号是？", Result = @"毒手无盐" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》空性是哪个门派？", Result = @"嵩山少林" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》明教的右使叫什么名字？", Result = @"范遥" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》明教的总部设在哪里？", Result = @"光明顶" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》明教的左使叫什么名字？", Result = @"杨逍" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》少林寺方丈的名字叫做什么？", Result = @"空闻" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》身中什么散筋骨酸软，不能使用内力？", Result = @"十香软筋散" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》是发生在那个朝代的故事？", Result = @"元末" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》是那位先生所著？", Result = @"金庸" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》宋青书最终练成了什么武功与张无忌对抗？", Result = @"降龙十八掌" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》天鹰教的口号是什么？", Result = @"日月光照，鹰王展翅" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》韦一笑的绰号叫什么？", Result = @"青翼蝠王" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》小昭是波斯教的什么女？", Result = @"圣女" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》玄冥二老最终被谁收服？", Result = @"元朝收编" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》倚天剑里面嵌带着什么秘籍？", Result = @"九阴真经" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张翠山和殷素素是在什么情况下认识的？", Result = @"西湖" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张翠山和殷素素在什么情况下相识？", Result = @"西湖" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张无忌的父亲是谁？", Result = @"张翠山" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张无忌童年被困在那个山岛？", Result = @"冰火岛" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张无忌幼年身中什么掌法？", Result = @"玄冥神掌" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张无忌在哪里学的乾坤大挪移？", Result = @"明教" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》张无忌在使用龙爪手的同时，还糅合了哪些武功？", Result = @"乾坤大挪移" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》赵敏是那个种族的人？", Result = @"蒙古人" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》赵敏要求张无忌做的第三件事是?", Result = @"画眉" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》中，灭绝师太的俗家姓氏是什么？", Result = @"方" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》中，张无忌是明教的第几代教主？", Result = @"三十四代" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"《倚天屠龙记》中，周芷若的母亲姓什么？", Result = @"薛" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"点苍山秀诚能隐，俗世心深不敢看。半月伤心半世悔，一弯冷月照寒潭。打一人物名称！", Result = @"一灯" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"归卧林下岂无心，誓向胡天扫旧尘。望断终南全不雪，空馀北斗照清魂。打一人物名称！", Result = @"王重阳" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"空怀蹑足纵云间，素手纤纤最可怜。早识江湖秋水满，冰山终老不须还。打一人物名称!", Result = @"张翠山" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"廿年相伴影无痕，我悦均兮君不闻。相看何须尽解语，爱花最是惜花人。打一人物名称！", Result = @"胡逸之" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"青锋心上因秋曲，红药桥边带血生。漫道天香温可倚，谁怜一醉断痴情。打一人物名称！", Result = @"夏雪宜" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"三人半月诚难解，百岁稚年最不通。浊世无心说赤子，未老白头若敢逢。打一人物名称！", Result = @"周伯通" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"我是尘间摆渡人，为君闲计百年身。会当一笑恩仇泯，故使青灯伴晓昏。打一人物名称！", Result = @"扫地僧" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"下面哪一项不是昆仑三圣的绰号？", Result = @"书圣" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"萧瑟平生只自知，玉箫忍按悼亡词。桃花飞影潮生后，尽想东邻一笑痴。打一人物名称!", Result = @"黄药师" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"血仇未解千人痛，意气何知万事空。一立仰天当一吼，空明何处说屠龙。打一人物名称!", Result = @"谢逊" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"烟尘起处泪阑珊，身事还同世事艰。豪杰会当仗气死，青山依旧雁门关。打一人物名称！", Result = @"萧峰" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"一生憔悴为离奇，空恨世情难尽知。从此休提聪辩事，沧桑梦里有玄机。打一人物名称！", Result = @"苏星河" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"遭逢如梦几重天，一掷江心最是缘。谢我无知堪子乐，漫点石头不解禅。打一人物名称！", Result = @"石破天" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"紫电冰心常可羡，青灯草莽怎相容。金笛一弄潇湘曲，铁马又惊楚汉风。打一人物名称！", Result = @"余渔同" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 6, Quiz = @"坐断东南战未休，英雄一面总无由。终来暗洒清明泪，祸起萧墙不尽愁。打一人物名称！", Result = @"陈近南" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 7, Quiz = @"千山鸟飞绝，万径人踪灭。孤舟蓑笠翁，独钓寒江雪。", Result = @"作者：唐代柳宗元 诗名：江雪" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 7, Quiz = @"日暮长江里，相邀归渡头。落花如有意，来去逐轻舟。", Result = @"作者：唐代储光羲 诗名：江南曲" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 7, Quiz = @"墙角数枝梅，凌寒独自开。遥知不是雪，为有暗香来。", Result = @"作者：北宋王安石 诗名：梅花" });
            quizs.Add(new Quizbase() { Id = quizid++, Part = 7, Quiz = @"白日依山尽，黄河入海流。欲穷千里目，更上一层楼。", Result = @"作者：唐代王之涣 诗名：登鹤雀楼" });

            using (var db = Open())
            {
                var query = db.QueryAndExecute<Quizbase>();
                if (query.Count > 0)
                    foreach (var quizbase in query)
                    {
                        db.Delete(quizbase);
                    }
                    
                db.Store(quizs);
            }
        }

        public static List<Users> ReadUsers()
        {

            using (var db = Open())
            {
                var query = db.Query<Users>();
                var user = query.Execute<Users>().ToList();
                return user;
            }
        }

        public static List<Quizbase> GetQuizList()
        {
            using (var db = Open())
            {
                var query = db.Query<Quizbase>();
                var quizs = query.Execute<Quizbase>().ToList();
                return quizs;
            }
        }

        public static
             List<Runner> GetTaskList()
        {
            using (var db = Open())
            {
                var query = db.Query<Task>();
                var tasks = query.Execute<Task>().ToList();
                List<Runner> returnsList = (from task in tasks
                                            orderby task.StartTime
                                            select new Runner()
                                            {
                                                ID = task.Id,
                                                StartTime =
                                                    (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, task.StartTime.Hour, task.StartTime.Minute, task.StartTime.Second)),
                                                EndTime = (new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, task.EndTime.Hour, task.EndTime.Minute, task.EndTime.Second)),
                                                Started = false,

                                                //                                ScreenPoints = new List<ScreenPoint>
                                                //{
                                                //    new ScreenPoint(new Point(50, 300)),
                                                //    new ScreenPoint(new Point(745, 440)),
                                                //    new ScreenPoint(new Point(1408, 65)),
                                                //    new ScreenPoint(new Point(832, 320)),
                                                //    new ScreenPoint(new Point(745, 441), deloy),
                                                //    new ScreenPoint(new Point(670, 584))
                                                //},
                                                IsNeedLoop = task.IsNeedLoop,
                                                LoopType = (LoopType)task.LoopType,
                                                //                                LoopEvent = new List<ScreenPoint>
                                                //{
                                                //    new ScreenPoint(new Point(975, 540)),
                                                //    new ScreenPoint(new Point(800, 505)),
                                                //    new ScreenPoint(new Point(800, 505)),
                                                //    new ScreenPoint(new Point(800, 505)),
                                                //    new ScreenPoint(WinAPI.VK_ESCAPE)
                                                //    //new ScreenPoint(new Point(970, 170))
                                                //},
                                                RunStatus = RunStatus.VReady,
                                                MinX = task.MinX,
                                                MaxX = task.MaxX,
                                                MinY = task.MinX,
                                                MaxY = task.MaxY,
                                                LoopDeloy = task.LoopDeloy == 0 ? 1000 : task.LoopDeloy,
                                                IsResetScreen = task.IsResetScreen,
                                                ResetDeloy = task.ResetDeloy,
                                                IsReseted = false,
                                                WeekDay = task.WeekDay
                                            }).ToList();
                foreach (var runner in returnsList)
                {

                        Runner runner1 = runner;
                        var opdata = (from player in db.AsQueryable<OpData>()
                                      where player.TaskId==runner1.ID && player.OpType==0
                                      select player).ToList();
                        
                        runner.ScreenPoints = (from opData in opdata
                                               orderby opData.Id
                                               select
                                                   new ScreenPoint()
                                                   {
                                                       DeloyTime = opData.DeloyTime == 0 ? 1000 : opData.DeloyTime,
                                                       keyInput = opData.keyInput,
                                                       KeyType = opData.KeyType,
                                                       ScPoint = new Point(opData.X, opData.Y)
                                                   }).ToList();
                        if (!runner.IsNeedLoop) continue;
                        opdata =
                            (from player in db.AsQueryable<OpData>()
                             where player.TaskId == runner1.ID && player.OpType == 1
                             select player).ToList();
                        runner.LoopEvent = (from opData in opdata
                                            orderby opData.Id
                                            select
                                                new ScreenPoint()
                                                {
                                                    DeloyTime = opData.DeloyTime == 0 ? 1000 : opData.DeloyTime,
                                                    keyInput = opData.keyInput,
                                                    KeyType = opData.KeyType,
                                                    ScPoint = new Point(opData.X, opData.Y)
                                                }).ToList();
                    }

                
                return returnsList;
            }
        }

    }
}
